<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Model_religion  extends CI_Model {
	 function __construct()
    {
        // Call the Model constructor
        parent::__construct();
		$table = 'meta_location';
    }
	
	
		
	
/*	function get_location($item='country',$id=''){
		
		$option = '<option value="0">--Select--</option>';
		$table = 'm_countries';
		if($item=='country')
			$query = $this->db->get($table,246,0);
		else if($item=='state'){
			$this->db->like('iso', 'IN');
			$this->db->order_by("name", "asc");
			$query = $this->db->get($table,246,0);
		 
			
		}
		foreach($query->result() as $row){
			 if($row->id == $id)
					 	 $option .='  <option value="'.$row->id.'" selected="selected">'.$row->name.'</option>';
					 else	 
					  $option .='  <option value="'.$row->id.'">'.$row->name.'</option>';
			}
	return $option;
	}
	
	function get_state($id=0,$state_id=0){
		$option ='<option value="0">--Select--</option>';
		$this->db->select('*');
		$this->db->from('m_states');
		$this->db->where('country_id',$id);
		$this->query  = $this->db->get();
		foreach($this->query->result() as $row){
			 if($row->state_id == $state_id)
			 	 $option .='  <option value="'.$row->state_id.'" selected="selected">'.$row->state_name.'</option>';
					 else	 
			  $option .='  <option value="'.$row->state_id.'">'.$row->state_name.'</option>';
			}
	   return $option;
	}
	
	function get_city($id=0){
		$option ='<option value="0">--Select--</option>';
		$this->db->select('*');
		$this->db->from('m_cities');
		$this->db->where('state_id',$id);
		$this->query  = $this->db->get();
		foreach($this->query->result() as $row){
			 if($row->city_id == $id)
			 	 $option .='  <option value="'.$row->city_id.'" selected="selected">'.$row->city_name.'</option>';
					 else	 
			  $option .='  <option value="'.$row->city_id.'">'.$row->city_name.'</option>';
			}
	   return $option;
	}
	function get_country_name($id){
		$this->db->select('name');
		$this->db->from('m_countries');
		$this->db->where("id" ,$id);
		$query = $this->db->get();
		$row = $query->result();
		return (isset($row[0]->name)) ? $row[0]->name : '';

	}
	function get_city_name($id){
		$this->db->select('city_name');
		$this->db->from('m_city');
		$this->db->where("city_id" ,$id);
		$query = $this->db->get();
		$row = $query->result();
		return (isset($row[0]->city_name)) ? $row[0]->city_name : '';

	}
	function get_state_name($id){
		$this->db->select('state_name');
		$this->db->from('m_states');
		$this->db->where("state_id" ,$id);
		$query = $this->db->get();
		$row = $query->result();
		return (isset($row[0]->state_name)) ? $row[0]->state_name : '';

	}*/
	
	
}